<include file="public:header" />

<div class="container">
    <h4 class="webview-title">{$store.name}</h4>
    <hr />
    <form id="formBox" role="form" action="__GROUP__?g=api&m=inspection&a=addTable" method="post">
        <input type="hidden" name="storeId" value="{$store.id}" />
        <volist name="table" id="v">
            <div class="form-group">
                <label>{++$key}. {$v.name}</label>
                <if condition="$v['type'] eq 'text'">
                    <input type="text" name="v[{$v.id}]" class="form-control" value="{$v.value}" id="v_{$v.id}" placeholder="0">
                </if>
				<if condition="$v['type'] eq 'radio'">
					<volist name="v.rules.choices" id="radio">
						<div class="radio">
							<label>
								<input type="radio" name="v[{$v.id}]" id="optionsRadios{$v.id}" value="{$radio.value}" {$v['value'] == $radio['value'] ? ' checked' : ''}>
							{$radio.txt}
							</label>
						</div>
					</volist>
                </if>
				<if condition="$v['type'] eq 'checkbox'">
					<volist name="v.rules.choices" id="checkbox">
						<div class="checkbox">
							<label>
							<input type="checkbox" name="v[{$v.id}]" id="checkbox{$v.id}" value="{$checkbox.value}" {$v['value'] == $checkbox['value'] ? ' checked' : ''}>
							{$checkbox.txt}
							</label>
						</div>
					</volist>
                </if>
				<if condition="$v['description']">
                <span class="help-block"><pre>{$v.description}</pre><span>
				</if>
            </div>
        </volist>
		<div class="msg alert">
        </div>
        <button type="submit" class="btn btn-primary btn-lg btn-block">提交</button>
    </form>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
</div>

<script type="text/javascript">
//$(document).ready(function(){
//    //绑定一个指定的表单
//    $('#formBox').ajaxForm({ 
//            //设置传输的数据类型
//            dataType:  'json', 
//            //请求成功后，调用的回调函数
//            success:  back
//    }); 
//
//
//	$('.msg').hide();
//
//	$("button").click(function(){
//		$('.msg').hide();
//		$('.msg').removeClass("alert-success");
//		$('.msg').removeClass("alert-danger");
//	});
//	
//    function back(data){
//		$('.msg').focus();
//        if(data.status === 200){
//			$('.msg').addClass("alert-success");
//			$('.msg').html(data.msg);
//			$('.msg').show();
//        }else{
//			$('.msg').addClass("alert-danger");
//			$('.msg').html(data.msg);
//			$('.msg').show();
//        }
//    }
//});

</script>

<include file="public:footer" />